package com.dzl.base.service;

import java.util.List;

import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Autowired;

import com.dzl.base.mapper.BaseMapper;
import com.dzl.base.pojo.BasePojo;
import com.dzl.config.database.Master;

import tk.mybatis.mapper.entity.Example;

/**
 * @author dzl
 */
public abstract class BaseServiceImpl<T extends BasePojo> implements BaseService<T> {

	@Autowired
    private BaseMapper<T> mapper;

    @Override
    public List<T> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public T selectByPrimaryKey(Object obj) {
        return mapper.selectByPrimaryKey(obj);
    }
    @Master
    @Override
    public int deleteByPrimaryKey(Object obj) {
        return mapper.deleteByPrimaryKey(obj);
    }
    @Master
    @Override
    public int updateByPrimaryKey(T t) {
        return mapper.updateByPrimaryKey(t);
    }

    @Override
    public T selectOne(T t) {
        return mapper.selectOne(t);
    }

    @Override
    public List<T> select(T t) {
        return mapper.select(t);
    }
    @Master
    @Override
    public int insert(T t) {
        return mapper.insert(t);
    }
    @Master
    @Override
    public int insertList(List<? extends T> t) {
        return mapper.insertList(t);
    }
    @Master
    @Override
    public int delete(T t) {
        return mapper.delete(t);
    }

    @Override
    public int selectCount(T t) {
        return mapper.selectCount(t);
    }
    @Master
    @Override
    public int insertSelective(T t) {
        return mapper.insertSelective(t);
    }

    @Override
    public int selectCountByExample(Example example) {
        return mapper.selectCountByExample(example);
    }

    @Override
    public List<T> selectByExample(Example example) {
        return mapper.selectByExample(example);
    }
    @Master
    @Override
    public int deleteByExample(Example example) {
        return mapper.deleteByExample(example);
    }
    @Master
    @Override
    public int updateByExample(T t, Example example) {
        return mapper.updateByExample(t, example);
    }
    @Master
    @Override
    public int updateByPrimaryKeySelective(T t) {
        return mapper.updateByPrimaryKeySelective(t);
    }
    @Master
    @Override
    public int updateByExampleSelective(T t, Example example) {
        return mapper.updateByExampleSelective(t, example);
    }

    @Override
    public T selectOneByExample(Example example) {
        return mapper.selectOneByExample(example);
    }

    @Override
    public List<T> selectByRowBounds(T t, RowBounds rowBounds) {
        return mapper.selectByRowBounds(t, rowBounds);
    }

    @Override
    public List<T> selectByExampleAndRowBounds(Example example, RowBounds rowBounds) {
        return mapper.selectByExampleAndRowBounds(example, rowBounds);
    }
}
